from appium import webdriver
import pkg_resources

cap = {
  'platformName': 'Android',
  'platformVersion': '7.1.2',
  'deviceName': '192.168.2.163:5555',
  'udid': '192.168.2.163:5555',
  'appPackage': 'com.ss.android.ugc.aweme',
  'appActivity': 'com.ss.android.ugc.aweme.splash.SplashActivity',
  'noReset': True,
  'unicodeKeyboard': True,
  'resetKeyboard': True,
  'automationName': 'UiAutomator2'
}
driver = webdriver.Remote('http://192.168.2.162:4723', cap)

# 尝试获取 Appium Python 客户端的版本号
version = pkg_resources.get_distribution("Appium-Python-Client").version
print("Appium Python Client Version:", version)

driver.quit()